#pragma once
#include "sgobject.h"
#include "sgptr.h"
#include "graphics/GrVector.h"

class CSgRotateAroundPoint :
	public CSgObject
{
public:
	CSgRotateAroundPoint() {m_cx=m_cy=m_cz=m_rx=m_ry=m_rz=m_degrees = 0.; m_child = NULL;}

	CSgRotateAroundPoint(double degrees, CGrVector center, CGrVector rotationAxes)
	{
		//CSgRotateAroundPoint(degrees, center.X(), center.Y(), center.Z(),
		//rotationAxes.X(), rotationAxes.Y(), rotationAxes.Z());
		m_degrees=degrees;
		m_cx = center.X(); m_cy = center.Y(); m_cz = center.Z();
		m_rx=rotationAxes.X(); m_ry=rotationAxes.Y(); m_rz = rotationAxes.Z();
		m_child = NULL;
	}

	CSgRotateAroundPoint(double degrees, double cx, double cy, double cz,
		double rx, double ry, double rz)
	{
		m_degrees=degrees;
		m_cx = cx; m_cy = cy; m_cz = cz;
		m_rx=rx; m_ry=ry; m_rz = rz;
		m_child = NULL;
	}
	~CSgRotateAroundPoint();
	virtual void Render();
	void SetChild(CSgObject *p_child) {m_child = p_child;}

	void SetCenter(double cx, double cy, double cz){m_cx = cx; m_cy = cy; m_cz = cz;}
	void SetRotationAxis(double rx, double ry, double rz){m_rx = rx; m_ry = ry; m_rz = rz;}
	void SetDegrees(double degrees){m_degrees = degrees;}

private:
	CSgPtr<CSgObject> m_child;
	double m_degrees; // degrees
	double m_cx, m_cy, m_cz; // around which point
	double m_rx, m_ry, m_rz; // rotation axes
};
